Skip to content

Bug 2046794 - Bugs cannot be updated if they contain a meta keyword after recent changes to show dependency tree inline#2645

Closed
dklawren wants to merge 2 commits into
mozilla-bteam:masterfrom
dklawren:2046794
Closed

Bug 2046794 - Bugs cannot be updated if they contain a meta keyword after recent changes to show dependency tree inline#2645
dklawren wants to merge 2 commits into
mozilla-bteam:masterfrom
dklawren:2046794

Conversation

@dklawren

Copy link
Copy Markdown
Collaborator

Summary

Root cause: PR #2636/#2637 embed the dependency tree directly into the bug page for meta bugs. The tree HTML is injected (extensions/BugModal/web/bug_modal.js → initDependencyTree) into #dependency-tree-container, which lives inside

(edit.html.tmpl lines 145–1463). That injected HTML includes a depth-control .

The save handler in bug_modal.js:813 does:
if (hasInvalidField || !$form.checkValidity()) return;
checkValidity() validates every control in the form, including the injected number input. When a meta bug's tree has realdepth=0 — no open dependencies, which is now common because Bug 2046200 (commit fbaac11) made hide_resolved=1 the default for the embedded fetch — the input renders as min="1" max="0" value="0", which is invalid. So checkValidity() returns false and submit silently returns: no error, no network request. Exactly the reported symptom. Meta bugs that still have open dependencies (realdepth ≥ 1) submit fine, which is why it looked intermittent/meta-specific.

Fix: In template/en/default/bug/dependency-tree.html.tmpl, floor the input's max and value at 1 so the control always satisfies its own constraints, even when realdepth=0. No JS changes needed — the input element stays present (so disableControllers/updateControllers don't hit a null), and the depth toolbar is harmless/disabled on an empty tree anyway. The standalone tree page is unaffected (it has no surrounding validated form, and max=1 value=1 is more correct than the previous 0).

This is a one-template quick fix rather than a back-out, so the embedded dependency tree feature stays in place.

…fter recent changes to show dependency tree inline

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a regression where editing/saving meta bugs can silently fail after embedding the dependency tree inside the bug edit form, due to an invalid “Max Depth” <input type="number"> when realdepth = 0 (no open dependencies).

Changes:

  • Floors the dependency tree “Max Depth” input’s max and default value to 1 when realdepth is 0.
  • Adds an inline template comment documenting the checkValidity() failure mode when the tree is embedded in the bug change form.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

kyoshino added a commit to kyoshino/bmo that referenced this pull request Jun 11, 2026
@dklawren

dklawren commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator Author

Will be fixed instead by pr #2643

@dklawren dklawren closed this Jun 11, 2026
@dklawren dklawren deleted the 2046794 branch June 11, 2026 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants